<!--
 * @Author: your name
 * @Date: 2021-06-07 13:51:37
 * @LastEditTime: 2021-06-08 16:18:29
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \bazai_ebook\src\components\ebook\EbookMenu.vue
-->
<template>
  <div>
    <transition name="slide-up">
      <div class="menu-wrapper" :class="{'hide-box-shadow': !menuVisible || settingVisible >= 0 }" v-show="menuVisible">
        <div class="icon-wrapper">
          <span class="icon-menu" @click="showSetting(3)"></span>
        </div>
        <div class="icon-wrapper">
          <span class="icon-progress" @click="showSetting(2)"></span>
        </div>
        <div class="icon-wrapper">
          <span class="icon-bright" @click="showSetting(1)"></span>
        </div>
        <div class="icon-wrapper">
          <span class="icon-A" @click="showSetting(0)"></span>
        </div>
      </div>
    </transition>
    <ebook-setting-font />
    <ebook-setting-font-popup />
    <ebook-setting-theme />
    <ebook-setting-progress :currentIndex="currentIndex" />
    <ebook-slide />
  </div>
</template>

<script>
import { ebookMixin } from '@/mixins/mixin'
// import { defineComponent } from 'vue'
export default {
  mixins: [ebookMixin],
  name: 'EbookMenu',
  data () {
    return {
      currentIndex: -1
    }
  },
  methods: {
    showSetting (key) {
      if (this.settingVisible === key) return
      this.setSettingVisible(key)
      this.currentIndex = key
    }
  }
}
</script>
<style lang="scss" scoped>
 .menu-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 200;
    display: flex;
    width: 100%;
    height: px2rem(48);
    background: white;
    box-shadow: 0 px2rem(-8) px2rem(8) rgba(0, 0, 0, .15);
    font-size: px2rem(20);
    &.hide-box-shadow {
      box-shadow: none;
    }
    .icon-wrapper {
      flex: 1;
      @include center;
      .icon-progress {
        font-size: px2rem(24);
      }
      .icon-bright {
        font-size: px2rem(22);
      }
    }
  }
</style>
